﻿<!DOCTYPE html>
<html lang="zh-CN">
<head>
    {% load bootstrap4 %}
    {% bootstrap_css %}
    {#    {% bootstrap_javascript %}#}
    <title>自动化测试平台</title>
    <link rel="stylesheet" type="text/css" href="/static/css/bootstrap.min.css"/>
    <link rel="stylesheet" type="text/css" href="/static/css/forms.css"/>

    <script type="text/javascript" src="/static/admin/js/vendor/jquery/jquery.js"></script>
    <script type="text/javascript" src="/static/admin/js/jquery.init.js"></script>
    <script type="text/javascript" src="/static/admin/js/core.js"></script>
    <script type="text/javascript" src="/static/admin/js/admin/RelatedObjectLookups.js"></script>
    <script type="text/javascript" src="/static/admin/js/actions.js"></script>
    <script type="text/javascript" src="/static/admin/js/urlify.js"></script>
    <script type="text/javascript" src="/static/admin/js/prepopulate.js"></script>
    <script type="text/javascript" src="/static/admin/js/vendor/xregexp/xregexp.js"></script>

    <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" type="text/css" href="/static/admin/css/responsive.css"/>
    <meta name="robots" content="NONE,NOARCHIVE"/>
</head>
<body role="document">
<!-- 导航栏-->
<nav class="navbar navbar-expand-sm bg-dark navbar-dark fixed-top">
    <div class="container">
        <li class="active"><a style='color:white' href="/bug_manage/">单一接口</a></li>
        <li><a style='color:white' href="/bug_manage/">流程接口</a></li>
        <li class="active"><a style='color:white' href="#">app缺陷</a></li>
        <li class="active"><a style='color:white' href="#">web缺陷</a></li>
        <ul class="nav justify-content-center">
        </ul>
        <ul class="nav justify-content-end" style="position:absolute; right:10px; bottom:0px; ">
            <li class="nav-link"><a style='color:white' href="#">{{ user }}</a></li>
            <li class="nav-link"><a style='color:white' href="/logout/">退出</a></li>
        </ul>
    </div>
</nav>
<!-- 搜索栏-->
<div class="page-header" style="padding-top: 0px;">
    <form class="navbar-form" method="get" action="/bugsearch/">
        {% csrf_token %}
        <input type="search" name="bugname" placeholder="名称" required>
        <button type="submit">搜索</button>
        <!-- 增加bug-->
        <div style="float:right;width:65%">
            <select name="Bug" id="id_Bug">
                <option value="" selected>----bug名称----</option>
            </select>
            <a class="related-widget-wrapper-link change-related" id="change_id_Set"
               data-href-template="/admin/bug/bug/__fk__/change/?_to_field=id&amp;_popup=1" title="更改选中的bug">
                <img src="/static/admin/img/icon-changelink.svg" alt="修改"/>
            </a>
            <a class="related-widget-wrapper-link add-related" id="add_id_Set"
               href="/bug/bug/add/?_to_field=id&amp;_popup=1" title="增加另一个 系统设置">
                <img src="/static/admin/img/icon-addlink.svg" alt="增加"/>增加
            </a>
        </div>
    </form>
</div>
<!-- bug列表-->
<div class="row" style="padding-top: 20px;">
    <div class="col-md-12">
        <table class="table table-striped" style="table-layout: fixed;">
            <style>
                td {
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                }
            </style>
            <thead>

            <tr>
                <th>ID</th>
                <th>产品</th>
                <th>bug名称</th>
                <th>bug详情</th>
                <th>解决状态</th>
                <th>严重等级</th>
                <th>创建人</th>
                <th>分配给</th>
                <th>创建时间</th>
                <th>编辑</th>
                <th>删除</th>

            </tr>
            </thead>
            <tbody>
            {% for bug in bugs %}
                <tr>
                    <td>{{ bug.id }}</td>
                    <td>{{ bug.Product.productname }}</td>
                    <td>{{ bug.bugname }}</td>
                    <td title="{{ bug.bugdetail }}">{{ bug.bugdetail }}</td>
                    <td>{{ bug.bugstatus }}</td>
                    <td>{{ bug.buglevel }}</td>
                    <td>{{ bug.bugcreater }}</td>
                    <td>{{ bug.bugassign }}</td>
                    <td>{{ bug.created_time }}</td>
                    <td><a style="color:#0068ff" class="related-widget-wrapper-link add-related" id="add_id_Bug"
                           href="../admin/bug/bug/{{ bug.id }}/change/?_to_field=id&_popup=1"><img
                            src="/static/admin/img/icon-changelink.svg"/></a></td>
                    <td><a style="color:#0068ff" class="related-widget-wrapper-link add-related" id="add_id_Bug"
                           href="../admin/bug/bug/{{ bug.id }}/delete/?_to_field=id&_popup=1"><img
                            src="/static/admin/img/icon-deletelink.svg"/></a></td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
</div>
<!--统计和翻页功能-->
<span style="position:absolute; left:600px; bottom:30px;">   {# 把翻页功能固定显示在右下角#}
<div class="container-fluid margin_bottom_5 margin_top_5 clear_padding text-center"
     style="position:absolute; width:120px;">
共:{{ bugcounts }}条记录 {# 前端读取定义的变量#}
</div>
<div class="container">
    <ul class="pagination" id="pager">
          {# 上一页链接开始#}
        {% if bugs.has_previous %}
            {#  如果有上一页则正常显示上一页链接#}
            <li class="previous"><a href="/bug_manage/?page={{ bugs.previous_page_number }}">上一页</a></li>
            {#  上一页标签 #}
        {% else %}
            <li class="previous disabled"><a href="#">上一页</a></li> {# 如果当前不存在上一页则上一页的链接不可点击#}
        {% endif %}
        {# 上一页链接开始#}
        {% for num in bugs.paginator.page_range %}
            {% if num == currentPage %}
                <li class="item active"><a href="/bug_manage/?page={{ num }}">{{ num }}</a></li> {#显示当页数链接#}
            {% else %}
                <li class="item"><a href="/bug_manage/?page={{ num }}">{{ num }}</a></li>
            {% endif %}
        {% endfor %}

        {# 下一页链接开始#}
        {% if bugs.has_next %} {#  如果有下一页则正常显示下一页链接#}
            <li class="next"><a href="/bug_manage/?page={{ bugs.next_page_number }}">下一页</a></li>
        {% else %}
            <li class="next disabled"><a href="#">下一页</a></li>
        {% endif %}
        {# 下一页链接结束#}
    </ul>
</div>
</span>
</body>
</html>
